<?php


namespace App\Transformers;


use League\Fractal\TransformerAbstract;

class DeliveryServiceTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
        return [
            'id' => $data->id,
            'nickname' => $data->nickname ?? '',
            'avatar' => $data->avatar ?? '',
            'phone' => $data->phone ?? '',
            'status' => $data->status ?? '',
            'name'=>$data->name ??'',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];

    }
}
